﻿using System.Diagnostics;

namespace DimensionsHelper.LanguageService.Syntax;

public class MetadataAxis : MetadataSingleArgumentSuffix<StringLiteral>
{
    internal MetadataAxis(SyntaxToken axisKeywordToken, SyntaxNode? parent) :
        base(SyntaxKinds.MetadataAxis,
            axisKeywordToken,
            NodeConverter.ToIdentifier(axisKeywordToken),
            parent)
    {
    }
}


public static partial class NodeFactory
{
    public static MetadataAxis CreateMetadataAxis(SyntaxNode? parent, SyntaxToken axisKeywordToken,
        StringLiteral? expression)
    {
        Debug.Assert(axisKeywordToken.IsNode(SyntaxKinds.AxisKeywordToken));
        MetadataAxis axis = new(axisKeywordToken, parent);
        return UpdateMetadataSingleArgumentSuffix(axis, expression);
    }
}